﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Brain.Ballistics3D
{
    public class WeaponInfoManager : IEngineManager
    {
        public static Dictionary<int, WeaponInfo> Weapons;

        public static bool MaintainThroughResets = true;

        public WeaponInfoManager()
        {
            if (Weapons == null)
            {
                Weapons = new Dictionary<int, WeaponInfo>();
            }
        }

        public static void AddWeapon(int weaponId, WeaponInfo info)
        {
            Weapons.Add(weaponId, info);
        }
        public static WeaponInfo GetWeapon(int weaponID)
        {
            return Weapons[weaponID];
        }

        public static void MakeWeaponsInfos()
        {
            if (Weapons.Count == 0)
            {
                WeaponInfo hammer = new WeaponInfo();
                hammer.IsMelee = true;
                hammer.TimeBetweenShots = 500;
                hammer.ModelPlace = "skin:Models\\hammer";
                AddWeapon(0, hammer);

                WeaponInfo bananaT = new WeaponInfo();
                bananaT.IsMelee = false;
                bananaT.TimeBetweenShots = 500;
                bananaT.ModelPlace = "skin:Models\\Weapons\\banana";
                AddWeapon(1, bananaT);
            }
        }


        public void Reset()
        {
            if (!MaintainThroughResets)
            {
                Weapons.Clear();
                Weapons = new Dictionary<int, WeaponInfo>();
            }
        }

        public SerializationData Data { get; set; }
        public void SerializeData(DefaultSerializationManager manager)
        {
        }
        public void DeserializeData(DefaultSerializationManager manager, SerializationData newData)
        {
        }
    }
}
